package com.yanqu.road.server.cmd.activity.bulletscreen;

import com.yanqu.road.pb.activity.BulletScreenProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.bulletscreen.CrossActivityBulletScreenMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_ACTIVITY_INIT_BULLET_SCREEN, desc = "初始弹幕")
public class CrossInitBulletScreenCmd extends CrossCommand {

    int activityId;

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        BulletScreenProto.CrossActivityInitOrReloadMsg reqMsg = BulletScreenProto.CrossActivityInitOrReloadMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossActivityBulletScreenMgr.initOrReloadMsgData(activityId, true);
    }

    @Override
    public void sendData() {

    }
}
